@use 'sass:map';
@use 'sass:color';
@use '@angular/material' as mat;

@mixin color($config-or-theme) {
  $config: mat.get-color-config($config-or-theme);
  $background: map.get($config, background);
  $foreground: map.get($config, foreground);
  $primary: map.get($config, primary);
  $accent: map.get($config, accent);

  .pac-widget-filter-bar {
    &.editable {
      .ngm-smart-filter-bar_filter {
        border-radius: 5px;
        border: 1px dashed transparent;
        &.actived {
          border-color: map-get($accent, 500);
        }
      }
    }
  }
}

@mixin typography($config-or-theme) {
}

@mixin density($config-or-theme) {
  .pac-widget-filter-bar {
    &.ngm-density__cosy {
      font-size: 12px;
    }
    &.ngm-density__compact {
      font-size: 10px;
    }
  }
}

@mixin theme($theme) {
  $color: mat.get-color-config($theme);
  $density: mat.get-density-config($theme);
  $typography: mat.get-typography-config($theme);

  @if $color != null {
    @include color($color);
  }
  @if $density != null {
    @include density($density);
  }
  @if $typography != null {
    @include typography($typography);
  }
}
